package com.zr.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.zr.dao.ReprotDao;
import com.zr.service.ReprotService;

import net.sf.json.JSONObject;

/**
 * 收货报表服务层
 * @author huzhou
 *
 */

@Service("recservice")
public class RecReprotServiceImpl implements ReprotService{
    @Resource
	private ReprotDao reprotDao;
	@Override
	public JSONObject selectRecReprotMsg(String year, String[] month, int page, int rows) {
		// TODO Auto-generated method stub
		JSONObject obj = new JSONObject();
		try{
			obj.put("total",reprotDao.findReprotMsgCount(year, month));
			obj.put("rows", reprotDao.selectReprot(year, month, page, rows));
		}catch(Exception e){
			e.printStackTrace();
		}
		return obj;
	}
	@Override
	public JSONObject selectDelReprotMsg(String year, String[] month, int page, int rows) {
		// TODO Auto-generated method stub
		JSONObject obj = new JSONObject();
		try{
			obj.put("total",reprotDao.finddelReprotMsgCount(year, month));
			obj.put("rows", reprotDao.selectdelReprot(year, month, page, rows));
		}catch(Exception e){
			e.printStackTrace();
		}
		return obj;
	}
	@Override
	public JSONObject selectRDReprotMsg(String year, String[] month, int page, int rows) {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	public JSONObject selectGReprotMsg(String year, String[] month, int page, int rows) {
		// TODO Auto-generated method stub
		JSONObject obj = new JSONObject();
		try{
			obj.put("total",reprotDao.findGReprotMsgCount(year, month));
			obj.put("rows", reprotDao.selectGReprot(year, month, page, rows));
		}catch(Exception e){
			e.printStackTrace();
		}
		return obj;
	}
     
}
